package com.Thread;

import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author: sun.hongliang
 * @create: 2018/10/29 11:52
 */
public class ThreadLocalTest {
    private static ThreadLocal<String> threadLocal = ThreadLocal.withInitial(() -> "2222");

    public String getName() {
        return threadLocal.get();
    }


    public static void main(String[] args) throws Exception {
        threadLocal.set("test");
        String string = threadLocal.get();
        System.out.println(string);
        ConcurrentHashMap<String, String> hashMap = new ConcurrentHashMap<>();
        hashMap.put("a", "b");
        hashMap.get("a");
        hashMap.size();
        hashMap.remove("a");

        HashMap<String, String> mm = new HashMap<>();
        mm.put("a", ";");
        mm.get("a");
    }
}
